package org.onion.pattern.sample.active.service.event;

import com.github.f4b6a3.uuid.UuidCreator;
import org.onion.pattern.event.domain.Event;
import org.onion.pattern.event.io.codec.ProtobufEventCodec;
import org.onion.pattern.event.outbox.annotation.Outbox;
import org.onion.pattern.event.springboot.rocketmq.annotation.RocketMQEvent;

import java.time.LocalDateTime;


@Outbox(value = "act", serializer = ProtobufEventCodec.TYPE)
@RocketMQEvent("ActUpdateEvent")
public class ActUpdateEvent  implements Event {

    private String eventKey;
    private LocalDateTime eventTime;

    public ActUpdateEvent(){
        eventKey = UuidCreator.getTimeOrderedEpoch().toString();
        eventTime = LocalDateTime.now();
    }


    @Override
    public String eventKey() {
        return eventKey;
    }

    @Override
    public LocalDateTime eventTime() {
        return eventTime;
    }



}
